<template>
	<view>
		<image :src="data.img" class="db w-max h370" mode="aspectFit"></image>
		<view class="bg-fff m20 radius20 p20">
			<view class="fs30 color-232323 fw-700">{{data.name}}</view>
			<view class="flex row-between flex-wrap pt10">
				<view class="mt10 fs26">
					<text class=" color-999">服务时间：</text>
					<text class=" color-666">{{data.service_time}}</text>
				</view>
				<view class="mt10 fs24 flex">
					<image src="/static/img/index/address.png" class="h26 w26" mode=""></image>
					<text class="color-232323 ml10 flex1">{{data.address}}</text>
				</view>
			</view>
			<!-- <scroll-view scroll-x class="flex fs22  nowrap">
				<view v-for="(item,index) in data.types" :key="index" class="px20 py6 radius8 mr20 dib mt12"
					:class="index==0?'cyan':index==1?'yellow':'blue'">{{item}}</view>
			</scroll-view> -->
			<types :list="data.types" />
		</view>
		<view class="radius20 bg-fff m20 p20 pb26">
			<view class=" flex">
				<view class="fs28 fw-700  bottom pb6"> 医院简介</view>
			</view>
			<view class="mt14 fs26 color-666 lh15" v-if="data.profile">
				<u-read-more toggle show-height="600">
					<rich-text :nodes="data.profile" />
				</u-read-more>
			</view>
		</view>

		<view class="m20 mt24 flex">
			<view class="fs30 fw-700  bottom pb6">服务项目</view>
		</view>
		<view class="">
			<serviceList :list="list" />
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				data: '',
				list: '',
				page: 1,
			};
		},
		onLoad() {
			this.getData()
			this.getList()
		},
		onReachBottom() {
			this.getList('down')
		},
		methods: {
			getData() {
				this.$request('/member/search/hospitalInfo', this.$params).then(res => {
					this.data = res.data
					uni.setNavigationBarTitle({
						title: res.data.name
					})
					this.shareData.title = this.$config.shop_title + ' ' + res.data.name
				})
			},
			hospitalService(e) {
				e == 'down' ? this.page++ : this.page = 1
				let params = {
					...this.$params,
					page: this.page,
				}
				this.$request('/member/search/hospitalService', params).then(res => {
					let list = res.data.data
					e == 'down' ? this.list.push(...list) : this.list = list
				})
			},
			getList(e) {
				e == 'down' ? this.page++ : this.page = 1
				let params = {
					...this.$params,
					page: this.page,
				}
				this.$request('/member/search/hospitalService', params).then(res => {
					let list = res.data.data
					e == 'down' ? this.list.push(...list) : this.list = list
				})
			},
		}
	}
</script>

<style lang="scss">
</style>
